// components/hl-button/hl-button.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    content: {
      type: String,
      value: ''
    },
    borderRadius: {
      type: Number,
      value: ''
    },
    fontSize: {
      type: Number,
      value: 34
    },
    openType: {
      type: String,
      value: ''
    },
    formType: {
      type: String,
      value: ''
    },
    bgColor: {
      type: String,
      value: 'linear-gradient(90deg, #FE877E 0%, #C7000B 100%);'
    },
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    onButton: function(e) {
      this.triggerEvent('btn', null, {});
    },
    //手机号回调
    onPhoneNumber: function(e) {
      let detail = e.detail;
      this.triggerEvent('getphonenumber', detail, {});
    },
    //获取用户信息
    onUserInfo:function(e) {
      let detail = e.detail;
      this.triggerEvent('getuserinfo', detail, {});
    },
    //打开设置
    onOpenSetting: function(e) {
      let isOpenUserLocation = e.detail.authSetting['scope.userLocation'];
      let isOpenWritePhotosAlbum = e.detail.authSetting['scope.writePhotosAlbum'];
      let myEventDetail = {
        isOpenUserLocation: isOpenUserLocation,
        isOpenWritePhotosAlbum: isOpenWritePhotosAlbum
      }
      this.triggerEvent('opensetting', myEventDetail, {});
    }
  }
})